package com.fusion.lottery.auth.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fusion.lottery.auth.service.SourceService;
import com.fusion.lottery.entity.auth.Source;
import com.fusion.lottery.mapper.auth.SourceMapper;
import com.fusion.utils.json.Msg;
import com.fusion.utils.json.QueryResult;

@Service
public class SourceServiceImpl implements SourceService{
	
	@Autowired
	private SourceMapper sourceMapper;

	@Override
	public Msg list(Source source, long start, long pageSize) {
		// TODO Auto-generated method stub
		List<Source> list = sourceMapper.list(source,start,pageSize);
		QueryResult qs = new QueryResult(list,sourceMapper.count(source));
		return new Msg(qs);
	}

	@Override
	public Msg get(long id) {
		// TODO Auto-generated method stub
		Source source = sourceMapper.get(id);
		return new Msg(source);
	}

	@Override
	public Msg update(Source source) {
		// TODO Auto-generated method stub
		sourceMapper.update(source);
		return new Msg();
	}
	
	
}
